package com.treeHole.treeHoleServer.utils;

import java.util.HashSet;
import java.util.Random;

public class RandomUsernameGenerator {
    private static final String[] places = {
            "西一", "西二", "百惠园", "百景园", "紫荆园", "东一", "东三",
            "韵酒", "学一", "学二", "东教工", "百盛园"};
    private static final String[] food={
            "红烧肉", "烧腊饭", "鱼香肉丝", "宫保鸡丁", "青椒肉丝",
            "麻婆豆腐", "扬州炒饭", "水煮鱼", "番茄炒蛋", "辣子鸡",
    "麻辣香锅","铁板饭","牛肉面","酸辣粉","烤五花肉","油泼面","土豆泥盖饭","水饺"};
    public static String getDifName(HashSet<String> existNames){
        Random random = new Random();
        String username;
        do {
            // Randomly select a place and a food item to create a username
            String place = places[random.nextInt(places.length)];
            String foodItem = food[random.nextInt(food.length)];
            username = place + foodItem;
        } while (existNames.contains(username));  // Check if the generated username already exists
        return username;  // Return the unique username
    }

}
